package main

import "fmt"

type ShowB interface {
	ShowB()
}

type People struct{}

func (p *People) ShowA() {
	fmt.Println("showA")
	p.ShowB()
}
func (p *People) ShowB() {
	fmt.Println("showB")
}

type Teacher struct {
	People
}

func (t *Teacher) ShowB() {
	fmt.Println("teacher showB")
}

func main() {
	t := &Teacher{}
	t.ShowA()
	t.ShowB()

	fmt.Println("---多态----")

	// 通过接口实现 多态
	var itfShowB ShowB

	itfShowB = t
	itfShowB.ShowB()

	itfShowB = &(t.People)
	itfShowB.ShowB()
}
